package cn.sczc.jh.client.controller.sys;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import cn.sczc.jh.client.base.AbstractController;
import cn.sczc.jh.client.entity.Permission;
import cn.sczc.jh.client.service.sys.PermissionService;

@RestController
@RequestMapping("/sys/per")
public class PermissionController extends AbstractController{
	@Autowired
	private PermissionService permissionService;
	/**
	 * 获取所有的权限
	 * @param request
	 * @param response
	 * @param model
	 * @return
	 */
	@RequestMapping(value = "",method=RequestMethod.GET)
	public ResponseEntity<ModelMap> qryAllPermission(ModelMap modelMap, HttpServletRequest request,
			HttpServletResponse response) {
		List<Permission> list=permissionService.getAllPermission();
		return setSuccessModelMap(modelMap, list);
	}
}
